#ifndef CREATURES_H
#define CREATURES_H
#define CREATURES_CAP 100
#include <cstdio>
#include <iostream>
#include <cstdlib> // need for function linux system in creatures errors class
#include <string>
#include "city_world_map_1_1.h"
namespace anima {
enum class race {indefinite=0};
struct coordinates{int x; int y;}; // simple C struct
class creatures{
public:
	 creatures();
	 creatures(world* sic_mundus_creatus_est_extended);
explicit creatures(world* sic_mundus_creatus_est_extended, int x, int y);
explicit creatures(world* sic_mundus_creatus_est_extended, coordinates refuge);
explicit creatures(world* sic_mundus_creatus_est_extended, int x, int y, int vitality, int force, int intelligence, bool sex, coordinates refuge, race);

explicit creatures(int* matrix_address, int elem1, int elem2);
explicit creatures(int* matrix_address, int elem1, int elem2, coordinates refuge);
explicit creatures(int* matrix_address, int elem1, int elem2, int x, int y, coordinates refuge);
explicit creatures(int* matrix_address, int elem1, int elem2, int x, int y, int vitality, int force, int intelligence, bool sex, coordinates refuge, race);
	virtual ~creatures();

protected:
unsigned long long int barcode;
mutable int x;
mutable int y;
const int x_size;
const int y_size;
mutable int hunger;
mutable std::string name{};
mutable std::string story{};
mutable int years;
mutable int months;
mutable int days;
const int vitality_cap;
int vitality;
const int force_cap;
int force;
const int intinct_cap;
int instinct;
mutable coordinates refuge;
private: 
//static creatures& set_default();
static creatures creatures_unborn;
static creatures& unborn();
const race indefinite;
bool male;
bool female;
bool* DNA;
int n_DNA;

virtual void animate()=0;
virtual void move()=0;
virtual void connexion()=0;
virtual void search_food()=0;
virtual void vision_area()=0;
virtual void sound_area()=0;
virtual void size()=0;
virtual void DNA_strand()=0;
sic_mundus_creatus_est::world* ptr; // need namespace

public:
virtual std::string representation(creatures& Creatures)const; // C++ String
virtual char* printf(creatures& Creatures); //C-Like string

inline int& get_x() const noexcept;
inline int& get_y() const noexcept;
inline void add_x() noexcept;
inline void remove_x() noexcept;
inline void set_x(int number_x) noexcept;
inline void set_y(int number_y) noexcept;
inline void add_y() noexcept;
inline void remove_y() noexcept;
inline int& get_hunger() const noexcept;
inline void set_hunger(int number_hunger) noexcept;
virtual void add_hunger() noexcept;
virtual void remove_hunger() noexcept;
inline void lot_of_hunger(int) noexcept;
inline int& get_vitality() const noexcept;
inline void set_vitality(int number_vitality) noexcept;
virtual void add_vitality() noexcept;
virtual void remove_vitality() noexcept;
inline void lot_of_vitality(int) noexcept;
inline int& get_force() const ;
inline void set_force(int number_force) noexcept;
virtual void add_force() noexcept;
virtual void remove_force() noexcept;
inline int& get_instinct() const noexcept;
inline void set_instinct(int number_instinct) noexcept; 
virtual void add_instinct() noexcept;
virtual void remove_instinct() noexcept;
inline void lot_of_instinct(int) noexcept;

virtual char* name_generate()=0;
virtual std::string name_generate_string()=0;
virtual std::string used_skill() const;
virtual void write_log_file_RAM()=0;
virtual void write_log_file_HD()=0;
}; //class end
//helper functions
creatures operator+(creatures Alpha, creatures Beta);
std::ostream& operator<<(ostream&, creatures Spectator);
std::istream& operator>>(istream&, creatures Actor);

class creatures_errors{
void seed_for_random(){
printf("Your program need a random time seed for operator+ CREATURES ERROR CODE=01 ");
std::cout<<"Creatures proliferate corrupted!!  press for continue and go change code in your main file"<<std::endl;
getchar();
system("read -n 1 -s -r -p 'Your program need a random time seed for operator +' ");
std::exit(0);
};

}
}//namesace anima end
#endif
